<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box">

    </div>
    <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    <script>
        $(function () {
            $('.box').append('<h3>hello world</h3>')
        })
        $('<h4>老村长</h4>').appendTo('.box').css('color', 'green').click(function () {
            console.log($(this).text());
        });
        $('h4').after('<h2>wusir</h2>')
    </script>
</body>

</html>